// The Vue build version to load with the `import` command
// (runtime-only or standalone) has been set in webpack.base.conf with an alias.
import Vue from 'vue'
import App from './App'
import router from './router'
import FastClick from 'fastclick'
import 'mint-ui/lib/style.css'
import 'assets/sass/style.scss'
import { VueScroller, RouterExtends } from 'base/'

File.prototype.loadBlob = async function () {
  return new Promise((resolve, reject) => {
    let fr = new FileReader()
    fr.onloadend = res => {
      resolve(res.target.result)
    }
    fr.onerror = reject
    fr.readAsArrayBuffer(this)
  })
}

Vue.config.productionTip = false

Vue.use(VueScroller)

FastClick.attach(document.body)

Vue.mixin({
  components: {
  },
  created () {
    this.$route && (this.routeName = this.$route.name)
  }
})

/* eslint-disable no-new */
new Vue({
  el: '#app',
  router,
  components: { App },
  template: '<App/>',
  mounted () {
    this.$nextTick(() => {
      RouterExtends.init(this.$router)
    })
  }
})
